using System;
using System.Text.RegularExpressions;

namespace Tool.BaseClass
{
	public class GClass36
	{
		public static string smethod_0(string string_0)
		{
			System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("(?<=\\()([^)]*?)(?=\\))", System.Text.RegularExpressions.RegexOptions.IgnoreCase | System.Text.RegularExpressions.RegexOptions.Singleline);
			System.Text.RegularExpressions.MatchCollection matchCollection = regex.Matches(string_0);
			string[,] array = new string[matchCollection.Count, 2];
			if (matchCollection.Count > 0)
			{
				for (int i = 0; i < matchCollection.Count; i++)
				{
					array[i, 0] = matchCollection[i].Value;
					array[i, 1] = i.ToString() + "_" + Guid.NewGuid().ToString("N");
					string_0 = string_0.Replace("(" + array[i, 0] + ")", "(" + array[i, 1] + ")");
				}
			}
			string_0 = string_0.Replace("'", "\"");
			string_0 = new System.Text.RegularExpressions.Regex("([\r\n\t])", System.Text.RegularExpressions.RegexOptions.Singleline).Replace(string_0, "");
			string_0 = new System.Text.RegularExpressions.Regex("([ ]*)>", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, " >");
			string_0 = new System.Text.RegularExpressions.Regex("([ ]*)/ >", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, " />");
			string_0 = new System.Text.RegularExpressions.Regex("[ ]{2,10000}", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, " ");
			string_0 = new System.Text.RegularExpressions.Regex("[ ]*:[ ]*", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, ":");
			string_0 = new System.Text.RegularExpressions.Regex("[ ]*;[ ]+", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, "; ");
			string_0 = new System.Text.RegularExpressions.Regex("([ ]*)=([ ]*)", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, "=");
			string_0 = new System.Text.RegularExpressions.Regex("(\\w+)=[ ]", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, "");
			if (new System.Text.RegularExpressions.Regex("</(\\w+)([ ]+)>", System.Text.RegularExpressions.RegexOptions.IgnoreCase | System.Text.RegularExpressions.RegexOptions.Singleline).Matches(string_0).Count > 0)
			{
				string_0 = string_0.Replace(" ", "");
			}
			string input = new System.Text.RegularExpressions.Regex("[ ](\\w+)=\"([^\"]*?)\"", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace(string_0, "");
			System.Text.RegularExpressions.MatchCollection matchCollection2 = new System.Text.RegularExpressions.Regex("(?<=[ ])(\\w+)=[^'^\"]([^ ]*?)[ ]", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Matches(input);
			if (matchCollection2.Count > 0)
			{
				for (int j = 0; j < matchCollection2.Count; j++)
				{
					string value = matchCollection2[j].Value;
					string text = value.Split(new char[]
					{
						'='
					})[0].Trim();
					string value2 = new System.Text.RegularExpressions.Regex("(?<=" + text + "=)([^ ]*?)(?=[ ])", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Matches(value)[0].Value;
					string_0 = string_0.Replace(value, text + "=\"" + value2 + "\" ");
				}
			}
			if (matchCollection.Count > 0)
			{
				for (int i = 0; i < matchCollection.Count; i++)
				{
					string_0 = string_0.Replace("(" + array[i, 1] + ")", "(" + array[i, 0].Trim().Replace("\"", "'") + ")");
				}
			}
			return string_0;
		}
	}
}
